﻿using System;
using System.Collections.Generic;
using System.Text;

namespace gChartSharp
{
    /// <summary>
    /// http://code.google.com/apis/chart/#chdl
    /// </summary>
    public class LegendPositionParam : IChartParam
    {
        public string Name { get { return "chdlp"; } }

        /// <summary>
        /// Position parameter
        /// </summary>
        public LegendPositionType Position { get; set; }


        /// <summary>
        /// Hide default constructor
        /// </summary>
        private LegendPositionParam() { }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="type"></param>
        public LegendPositionParam(LegendPositionType type)
        {
            this.Position = type;
        }


        /// <summary>
        /// Render the API text
        /// </summary>
        /// <returns></returns>
        public string Render()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(this.Position.ToString());
            return sb.ToString();
        }
    }


    /// <summary>
    /// 
    /// </summary>
    public enum LegendPositionType
    {
        /// <summary>
        /// Top
        /// </summary>
        t,

        /// <summary>
        /// Right
        /// </summary>
        r,

        /// <summary>
        /// Bottom
        /// </summary>
        b,

        /// <summary>
        /// Left
        /// </summary>
        l
    }
}
